﻿{extend name="layout/main-block" /}
{block name="sub-wrapper"}
        <!--内容容器-->
        <section id="sub-wrapper" class="full-screen page-device">
            <!--数据展示容器-->
            <div id="sub-content">
                <div id="sub-header">
                    <div class="sub-title">
                        <h3><i class="fa fa-puzzle-piece"></i>设备--设备列表</h3>
                    </div>
                    <div class="sub-tools">
                        <div id="searchTool">
                            <form class="form-inline">
                               <label class="">选择搜索条件:</label>
                                <!--<input size="10" class="form-control" id="startDate" />
                               <label class="">-</label>
                               <input size="10" class="form-control" id="endDate" />-->
                                <select id="Scondition" class="form-control">
                                    <option value="1">SN</option>
                                    <option value="2">IMEI</option>
                                    <option value="3">关联用户</option>
                                </select>
                                <input size="15" class="form-control" style="display: none" id="phname" />
                                <a class="btn btn-primary" id="searchname"><i class="fa fa-search"></i>搜索</a>
                                <a class="btn btn-info" id="delSearch"><i class="fa fa-search"></i>清空搜索</a>
                            </form>
                        </div>
                    </div>


                </div>

                <div class="table-responsive data-table">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                           <!-- <th class="text-center" width="34px">
                                <input type="checkbox" class="checkboxes" id="selectAll" />
                            </th>-->
                            <th>ID</th>
                            <th>设备SN</th>
                            <th>设备IMEI</th>
                            <th>设备SIM卡号</th>
                            <th>设备名称</th>
                            <th>关联账户</th>
                            <th>激活时间</th>
                            <th>工作时长</th>
                            <!--<th>代理商</th>-->
                            <th>设备组</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="device" id="v" empty="$empty" }
                        <tr>
                            <!--<td class="text-center">
                                <input type="checkbox" class="checkboxes" name="checkbox[]" />
                            </td>-->
                            <td>{$v.id}</td>
                            <td>{$v.sn}</td>
                            <td>{$v.imei}</td>
                            <td>{$v.sim}</td>
                            <td>{$v.name}</td>
                            <td>{$v.username}</td>
                            <td>{$v.actived_at}</td>
                            <td>{$v.worktime}</td>
                            <!--<td>{$v.fname}</td>-->
                            <td>{$v.gname}</td>
                            <td>
                                <ul class="record-tool">
                                    <li><a class="btn btn-info btn-sm viewRecord" data-name="{$v.id}">查看</a></li>
                                    <!-- <li><a class="btn btn-warning btn-sm editRecord" data-name="{$v.id}">修改</a></li> -->
                                    <!--<li><a class="btn btn-danger btn-sm delRecord" data-name="{$v.id}">删除</a></li>-->
                                    <!--<li><a class="btn btn-primary btn-sm stayRecord" data-name="{$v.id}"><i class="fa fa-map-marker"></i>当前位置</a></li>
                                    <li><a class="btn btn-info btn-sm historyRecord" data-name="{$v.id}"><i class="fa fa-map-marker"></i>历史轨迹</a></li>-->
                                </ul>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                        <tfoot>
                        <tr>
                           <!-- <td colspan="3">-->
                                <!--<ul class="record-tool">
                                    <li><a class="btn btn-success btn-sm" id="addRecord"><i class="fa fa-plus"></i>
                                        增加</a></li>
                                    <li><a class="btn btn-danger btn-sm" id="batchDel"><i class="fa fa-minus"></i>
                                        批量删除</a></li>
                                </ul>-->
                           <!-- </td>-->
                            <td colspan="5" class="">
                                {$page}
                                <!--<ul class="pagination">
                                    <li>
                                        <a href="#" aria-label="Previous">
                                            <span aria-hidden="true">&laquo;</span>
                                        </a>
                                    </li>
                                    <li class="active"><a href="#">1</a></li>
                                    <li><a href="#">2</a></li>
                                    <li><a href="#">3</a></li>
                                    <li><a href="#">4</a></li>
                                    <li><a href="#">5</a></li>
                                    <li><a href="#">...</a></li>
                                    <li><a href="#">999</a></li>
                                    <li>
                                        <a href="#" aria-label="Next">
                                            <span aria-hidden="true">&raquo;</span>
                                        </a>
                                    </li>
                                </ul>-->
                            </td>
                            <td colspan="3" class="text-center">
                                <div class="table-summary">
                                    <div class="input-group">
                                        <div class="input-group-addon">到第</div>
                                        <input type="text" class="form-control" id="goto" placeholder="" style="width:40px;">
                                        <div class="input-group-addon">页</div>
                                        <span class="input-group-btn">
                                                    <a class="btn btn-primary" data-currentPage="{$currentPage}" data-lastPage="{$lastPage}" id="gotoPage"><i class="fa fa-arrow-right"></i>确定</a>
                                                </span>
                                    </div>
                                </div>
                            </td>
                            <td colspan="2" class="text-center">
                                共<span id="total-record" class="text-success fa-2x"> {$count} </span>条记录
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </section>
{/block}

{block name="viewRecord"}
<!--编辑工具-->
<div id="viewRecord" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">ID:<span id="recordId"></span></h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal"  name="editForm">
                    <div class="row">
                        <div class="form-group col-xs-6">
                            <label for="sn_id">设备SN</label>
                            <select class="form-control" name="sn_id" id="sn_id">
                                {volist name="sn" id="s" empty="$empty" }
                                <option value="{$s.id}">{$s.sn}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group col-xs-6">
                            <label for="sim">设备SIM卡号</label>
                            <input type="text" class="form-control" name="sim" id="sim" >
                        </div>

                    </div>

                    <!--<div class="row">
                        <div class="form-group col-xs-6 ">
                            <label for="user_id">关联账户</label>
                            <select class="form-control" name="user_id" id="user_id">
                                {volist name="account" id="u" empty="--$--empty" }
                                <option value="{--$--u.id}">{--$--u.username}</option>
                                {/volist}
                            </select>

                        </div>
                        <div class="form-group col-xs-6 margin-10">
                            <label>状态</label>
                            <input type="radio" class="state s1" name="state"  value="1"  > 在线
                            <input type="radio" class="state s0" name="state"  value="0" > 离线
                        </div>
                    </div>-->
                    <div class="row">
                        <div class="form-group col-xs-6 ">
                            <label for="name">设备名称</label>
                            <input type="text" class="form-control" name="name" id="name" >
                        </div>
                        <div class="form-group col-xs-6">
                            <label for="device_group_id">设备组</label>
                            <select class="form-control" name="device_group_id" id="device_group_id">
                                {volist name="dGroup" id="g" empty="$empty" }
                                <option value="{$g.id}">{$g.name}</option>
                                {/volist}
                            </select>

                        </div>

                        <!--<div class="form-group col-xs-6 margin-10">
                            <label for="device_model_id">设备型号</label>
                            <select class="form-control" name="device_model_id" id="device_model_id">
                                {volist name="dm" id="m" empty="--$--empty" }
                                <option value="{--$--m.id}">{--$--m.name}</option>
                                {/volist}
                            </select>
                        </div>-->
                    </div>
                   <!-- <div class="row">-->

                        <!--<div class="form-group col-xs-6 ">
                            <label for="franchiser_id">代理商</label>
                            <select class="form-control" name="franchiser_id" id="franchiser_id">
                                {volist name="agent" id="a" empty="--$--empty" }
                                <option value="{--$--a.id}">{--$--a.name}</option>
                                {/volist}
                            </select>
                        </div>-->
                    <!--</div>-->
                    <!--<div class="row">
                        <div class="form-group col-xs-6">
                            <label for="car_model">车型</label>
                            <input type="text" class="form-control" name="car_model" id="car_model" >
                        </div>
                        <div class="form-group col-xs-6 ">
                            <label for="car_brand">车牌</label>
                            <input type="text" class="form-control" name="car_brand" id="car_brand">
                        </div>
                    </div>-->
                    <div class="row">
                        <!--<div class="form-group col-xs-6">
                            <label for="imei">IMEI</label>
                            <input type="text" class="form-control"  id="imei" name="imei">
                        </div>-->
                        <div class="form-group col-xs-6 ">
                            <label for="iccid">ICCID</label>
                            <input type="text" class="form-control" id="iccid" name="iccid" >
                        </div>
                    </div>
                    <!--<div class="row">
                        <div class="form-group col-xs-6">
                            <label for="devicewarning">设备告警事件</label>
                            <input type="text" class="form-control" name="devicewarning" id="devicewarning" placeholder="电源故障">
                        </div>
                        <div class="form-group col-xs-6 ">
                            <label for="devicetaffic">设备流量</label>
                            <input type="number" class="form-control" min="0" name="devicetaffic" id="devicetaffic" placeholder="2300MB">
                        </div>
                    </div>-->
                    
                    <!-- <div class="row">
                        <div class="form-group col-xs-6" id="fence">
                            <label>电子围栏</label>
                            <input type="text" class="form-control"  name="longitude" id="longitude" placeholder="经度" disabled>-
                            <input type="text" class="form-control"  name="latitude" id="latitude" placeholder="纬度" disabled>-
                            <input type="text" class="form-control"  name="radius" id="radius" placeholder="半径" disabled>
                        </div>
                    </div> -->

                </form>
            </div>
            <div class="clearfix"></div>
            <div class="modal-footer">
                <a class="btn btn-warning" data-dismiss="modal"><i class="fa fa-times"></i>关闭</a>
            </div>
        </div>
    </div>
</div>
<!--编辑工具-->

{/block}



